import java.util.Scanner;

public class MarketText {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        Market mu = new Market();
        while (true) {
            System.out.println("请选择功能\t1:添加新会员开卡,2:给某一用户涨分,3:兑换礼品,4:显示会员信息");
            int a = in.nextInt();
            if (a == 1) {
                System.out.println("会员号");
                String card = in.next();
                System.out.println("姓名");
                String username = in.next();
                System.out.println("手机号");
                String telephone = in.next();
                int grade;
                while (true){
                    System.out.println("积分");
                    grade = in.nextInt();
                    if(mu.opinion(grade))
                        break;
                    System.out.println("新会员的积分不能超过600");
                }
                mu.xinyonhu(card, username, telephone, grade);
            } else if (a == 2) {
                System.out.println("会员号");
                String card = in.next();
                System.out.println("增加积分");
                int num = in.nextInt();
                mu.jiafen(card, num);
            } else if (a == 3) {
                int num=0;
                System.out.println("会员号");
                String card = in.next();
                System.out.println("1：100分兑换餐巾纸一包；" +
                        "     2：400分兑换剃须刀一把；" +
                        "     3：1000分兑换炒锅一个；");
                int n = in.nextInt();
                if (n == 1) {
                    num = 100;
                } else if (n == 2) {
                    num = 400;
                } else if (n == 3) {
                    num = 1000;
                }else {
                    continue;
                }
                mu.duihuan(card,num);
                System.out.println(mu.duihuan(card,num));
            }else if(a==4){
                mu.xinxi();
            }
        }
    }
}
